package br.com.ffm.praticas.bean;

import java.util.GregorianCalendar;

import br.com.ffm.praticas.validator.Validator;

abstract class Person {
	
	private int id;
	private String name;
	private String lastName;
	private String rg;
	private String cpf;
	private Address homeAdress;
	private Contact contact;
	private PersonType personType;
	private GregorianCalendar birthday;
	
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param lastName the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * @param rg the rg to set
	 */
	public void setRg(String rg) {
		this.rg = rg;
	}

	/**
	 * @return the rg
	 */
	public String getRg() {
		return rg;
	}

	/**
	 * @param cpf the cpf to set
	 * @return true if the cpf is valid or false if cpf is invalid
	 */
	public boolean setCpf(String cpf) {
		if (Validator.cpfValidator(cpf)) {
			this.cpf = cpf;
		}
		return Validator.cpfValidator(cpf);
	}

	/**
	 * @return the cpf
	 */
	public String getCpf() {
		return cpf;
	}

	/**
	 * @param homeAdress the homeAdress to set
	 */
	public void setHomeAdress(Address homeAdress) {
		this.homeAdress = homeAdress;
	}

	/**
	 * @return the homeAdress
	 */
	public Address getHomeAdress() {
		return homeAdress;
	}

	/**
	 * @param contact the contact to set
	 */
	public void setContact(Contact contact) {
		this.contact = contact;
	}

	/**
	 * @return the contact
	 */
	public Contact getContact() {
		return contact;
	}

	/**
	 * 
	 * @param personType
	 */
	public void setPersonType(PersonType personType) {
		this.personType = personType;
	}

	/**
	 * 
	 * @return
	 */
	public PersonType getPersonType() {
		return personType;
	}

	/**
	 * 
	 * @param birthday
	 */
	public void setBirthday(GregorianCalendar birthday) {
		this.birthday = birthday;
	}

	/**
	 * 
	 * @return
	 */
	public GregorianCalendar getBirthday() {
		return birthday;
	}
	

}
